package com.faxsun.core.web.order.security;

import java.io.IOException;

import javax.annotation.Resource;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.broadleafcommerce.core.web.order.security.BroadleafAuthenticationSuccessHandler;
import org.springframework.security.core.Authentication;

import com.faxsun.core.web.security.service.FraudService;

public class FSAuthenticationSuccessHandler extends
		BroadleafAuthenticationSuccessHandler {

	@Resource(name = "fsFraudService")
	protected FraudService fraudService;
	
	@Override
	public void onAuthenticationSuccess(HttpServletRequest request,
			HttpServletResponse response, Authentication authentication)
			throws ServletException, IOException {

		fraudService.noitfyFraudLoginResult(request, Boolean.TRUE);
		super.onAuthenticationSuccess(request, response, authentication);
		
	}
}
